//package com.core.security;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
//import org.springframework.security.crypto.password.PasswordEncoder;
//
//
//@Configuration
//public class FurySpringSecurityConfig extends WebSecurityConfigurerAdapter {
//
//    /** 依赖注入自定义的登录成功处理器 */
//    @Autowired
//    private FuryAuthenticationSuccessHandler furyAuthenticationSuccessHandler;
//
//    /** 依赖注入自定义的登录失败处理器 */
//    @Autowired
//    private FuryAuthenticationFailureHandler furyAuthenticationFailureHandler;
//
//    //    向spring容器中创建一个Bean
//    @Bean
//    public PasswordEncoder passwordEncoder() {
//        return new BCryptPasswordEncoder();
//    }
//
//    @Override
//    protected void configure(HttpSecurity http) throws Exception {
//        http.formLogin()
//                .loginProcessingUrl("/users/login")
//                .successHandler(furyAuthenticationSuccessHandler)
//                .failureHandler(furyAuthenticationFailureHandler)
//                .and().authorizeRequests()
//                        .antMatchers("/users/login").permitAll()
//                        .anyRequest()
//                        .authenticated()
//                .and().csrf().disable();
//    }
//}
